/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.javacommunity.model.dao;

import com.javacommunity.model.entity.Post;
import java.util.List;

/**
 *
 * @author Pham
 */
public interface PostDAO {

    Post getPostById(int postId);

    /**
     *
     * @param param condition get Posts
     * @return
     * if(param = 1) then return all listOfPost with active = true
     * else if(param = 0) then return all listOfPost with active = false
     * else return All Post from DB
     */
    List<Post> getPosts(int param);
    
    /**
     * Get post pagination
     * @param firstRow get First row
     * @param lastRow get Last row
     * @return List's of Post
     */
    List<Post> getListOfPost(int firstRow, int lastRow);
    
    List<Post> getPostMostViewed();

    boolean createPost(Post post);

    boolean updatePost(Post post);

    public boolean updateViewCount(Post post);

    boolean deletePost(Post post);

    boolean removePost(Post post);

    boolean restorePost(Post post);

}
